﻿package com.tvein.sanguo.swc.common
{
	import flash.media.Sound;
	import flash.media.SoundTransform;
	import flash.media.SoundChannel;
	
	public class MP3Effect extends Sound
	{
		private var channel:SoundChannel;
		private var transform:SoundTransform = new SoundTransform();
		
		public function mp3()
		{
			
		}
		
		public function playback(vol:Number = 1) : void
		{
			transform.volume = vol;
			channel = this.play(0, int.MAX_VALUE, transform);
		}
		
		public function changeVolume(vol:Number) : void
		{
			transform.volume = vol;
			channel.soundTransform = transform;
		}
		
		public function stop() : void
		{
			channel.stop();
		}
	}
}